export type Method =
| 'OPTIONS'
| 'GET'
| 'HEAD'
| 'POST'
| 'PUT'
| 'DELETE'
| 'TRACE'
| 'CONNECT'

export interface RequestOptions {
  url?: string
  method?: Method
  headers?: any
  param?: any
  timeout?: number
  loading?: boolean
  errorTips?: boolean
  query?: any
  customCatch?: boolean
  force?: boolean
}

export interface UploadOptions {
  url?: string
  name: string
  upload?: boolean
  headers?: any
  loading?: boolean
  data?: any
  filePath: string
}

/**
 * 后端返回基础结构
 */
export interface ResponseBody<T = any> {
  code: number
  message: string
  data: T
}
